
<extend name="base" />
<block name="main">

<form action="" method="post" onsubmit="return check();"
	class="form-horizontal form" enctype="multipart/form-data">
	<h4></h4>
	<div class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-sm-1" style="width: 100px;">用户名</div>
				<div class="col-sm-3">
					<input type="text" name="username" id="username" value="{$listdata[name]}"
						class="form-control">
				</div>
				<div class="col-sm-1" style="width: 100px;">手机号码</div>
				<div class="col-sm-3">
					<input type="text" name="mobilenum" id="mobilenum" value='{$listdata[phone]}'
						class="form-control">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-1" style="width: 100px;">主页网址</div>
				<div class="col-sm-3">
					<input type="text" name="homeurl" id="homeurl" value="{$listdata[mainuri]}"
						class="form-control">
				</div>
				<if condition="$listdata[status]==1">
				<div class="col-sm-1" style="width: 100px;">状态</div>
				<div class="col-sm-3">
					<select name="status" class="dropdown-select form-control" id="status">
						<option value="1" selected="selected">正常</option>
						<option value="0">禁用</option>
					</select>
				</div>
				<else />
				<div class="col-sm-1" style="width: 100px;">状态</div>
				<div class="col-sm-3">
					<select name="status" class="dropdown-select form-control" id="status">
						<option value="1">正常</option>
						<option value="0" selected="selected">禁用</option>
					</select>
				</div>
				</if>
			</div>
			<div class="form-group">
				<div class="col-sm-1" style="width: 100px;">邮箱</div>
				<div class="col-sm-3">
					<input type="text" name="email" id="email" value="{$listdata[mail]}"
						class="form-control">
				</div>
				<div class="col-sm-1" style="width: 100px;">转载密码</div>
				<div class="col-sm-3">
					<input type="text" name="password" id="password" value="{$listdata[freightpassword]}"
						class="form-control">
				</div>
			</div>
			<div class="form-group">
				<if condition="$listdata[accounttype] eq 0">
				<div class="col-sm-1" style="width: 100px;">等级</div>
				<div class="col-sm-3">
					<select name="accounttype" class="dropdown-select form-control" id="accounttype">
						<option value="1" selected="selected">普通</option>
						<option value="0">vip</option>
					</select>
				</div>
				<else />
				<div class="col-sm-1" style="width: 100px;">等级</div>
				<div class="col-sm-3">
					<select name="accounttype" class="dropdown-select form-control" id="accounttype">
						<option value="1">普通</option>
						<option value="0" selected="selected">vip</option>
					</select>
				</div>
				</if>
				<div class="col-sm-1" style="width: 100px;">个人横幅图片</div>
				<div class="col-sm-3">
		            <div class="input-group row">
		                <div class="col-sm-9 big-photo">
		                	<div id="preview">
		                        <img id="imghead" border="0" src="__PUBLIC__/img/photo_icon.png" width="250" height="90" onclick="$('#previewImg').click();">
		                     </div>         
		                    <input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">
		                	<!--<input id="uploaderInput" class="uploader__input" style="display: none;" type="file" accept="" multiple="">-->
		                </div>
    <script>
      //图片上传预览    IE是用了滤镜。
        function previewImage(file)
        {
          var MAXWIDTH  = 90; 
          var MAXHEIGHT = 90;
          var div = document.getElementById('preview');
          if (file.files && file.files[0])
          {
              div.innerHTML ='<img id=imghead onclick=$("#previewImg").click()>';
              var img = document.getElementById('imghead');
              img.onload = function(){
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                img.width  =  rect.width;
                img.height =  rect.height;
//                 img.style.marginLeft = rect.left+'px';
                img.style.marginTop = rect.top+'px';
              }
              var reader = new FileReader();
              reader.onload = function(evt){img.src = evt.target.result;}
              reader.readAsDataURL(file.files[0]);
          }
          else //兼容IE
          {
            var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
            file.select();
            var src = document.selection.createRange().text;
            div.innerHTML = '<img id=imghead>';
            var img = document.getElementById('imghead');
            img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
            var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
            status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
            div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
          }
        }
        function clacImgZoomParam( maxWidth, maxHeight, width, height ){
            var param = {top:0, left:0, width:width, height:height};
            if( width>maxWidth || height>maxHeight ){
                rateWidth = width / maxWidth;
                rateHeight = height / maxHeight;
                
                if( rateWidth > rateHeight ){
                    param.width =  maxWidth;
                    param.height = Math.round(height / rateWidth);
                }else{
                    param.width = Math.round(width / rateHeight);
                    param.height = maxHeight;
                }
            }
            param.left = Math.round((maxWidth - param.width) / 2);
            param.top = Math.round((maxHeight - param.height) / 2);
            return param;
        }
    </script>
		            </div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-1" style="width: 100px;">出生年月</div>
				<div class="col-sm-3">
					<input type="text" name="borntime" id=""borntime"" value="{$listdata[borntime]}"
						class="form-control">
				</div>
			</div>
			<if condition="$listdata[bornaddress] eq ''">
			 <div id="distpicker">
			<div class="form-group">
				<div class="col-sm-1" style="width: 100px;">所在地区</div>
				<div class="col-sm-3">
						<select class="form-control" id="province10"></select>
				</div>
				<div class="col-sm-3">
						<select class="form-control" id="city10"></select>
				</div>
				<div class="col-sm-3">
						<select class="form-control" id="district10"></select>
						</div>
				
			</div>
		</div>
		<else />
			<div class="form-group">
				<div class="col-sm-1" style="width: 100px;">所在地区</div>
				<div class="col-sm-3">
						<input type="text" class="form-control" value="{$listdata[bornaddress]}"></select>
				</div>
				<div class="col-sm-3">
						<input type="text" class="form-control" value="{$listdata[bornaddress]}"></select>
				</div>
				<div class="col-sm-3">
						<input type="text" class="form-control" value="{$listdata[bornaddress]}"></select>
						</div>
				
			</div>
		</if>

		<div class="form-group">
			<if condition="$usertype eq 3">
			<div class="col-sm-1" style="width: 100px;">微信号</div>
				<div class="col-sm-3">
						<input type="text" name="weinum" id="weinum" value="{$listdata[weixin]}"
						class="form-control">
				</div>
			<elseif condition="$usertype eq 2" />
			<div class="col-sm-1" style="width: 100px;">qq号</div>
				<div class="col-sm-3">
						<input type="text" name="qqnum" id="" value="{$listdata[qq]}"
						class="form-control">
				</div>
			<elseif condition="$usertype eq 5" />
				<div class="col-sm-1" style="width: 100px;">微博账号</div>
				<div class="col-sm-3">
						<input type="text" name="qqnum" id="" value="{$listdata[weibo]}"
						class="form-control">
				</div>
			<elseif condition="$usertype eq 4" />
				<div class="col-sm-1" style="width: 100px;">支付宝账号</div>
				<div class="col-sm-3">
						<input type="text" name="qqnum" id="" value="{$listdata[payerbao]}"
						class="form-control">
				</div>
			</if>
			
			</div>
		<div class="form-group">
			<div class="col-sm-12">
				<button type="submit" class="btn btn-primary col-lg-1" name="submit"
					value="提交">提交</button>
			</div>
		</div>

	</div>
</form>
</block>